package com.xiaoy.core.base.security.role.action;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Results;
import org.springside.modules.utils.web.struts2.Struts2Utils;

import com.xiaoy.core.base.security.role.entity.Role;
import com.xiaoy.core.base.security.role.service.RoleService;
import com.xiaoy.web.BasicAction;

@Namespace("/base/security/role")
@Results({})
public class RoleAction extends BasicAction{

	@Resource
	private RoleService roleService;
	
	public String list () {
		
		request.setAttribute("pageBean", roleService.filterPage(initPageWrapper()));
		return "list";
	}
	
	
	public void list_json () {
		
		Struts2Utils.renderJson(roleService.filterPage(initPageWrapper()));
	}
	
	public void save () {
		
		roleService.save(bean);
	}
	
	
	private Role bean;

	public Role getBean() {
		return bean;
	}

	public void setBean(Role bean) {
		this.bean = bean;
	}

}
